package com.xsmart.oa.services;

import com.xsmart.common.constant.ResultConstant;
import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.oa.dao.SysParamDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author chenzb
 * @create 2018-01-15 下午5:02
 **/
@Service
public class SysParamService {


    @Autowired
    SysParamDAO sysParamDAO;

    public ResponseBean getSysParamInfo(RequestBean requestBean) {
        String paramCode = requestBean.getRequestParamString("paramCode");
        ResponseBean responseBean = requestBean.getResponseBean();

        Map<String, Object> sysParamMap = sysParamDAO.getSysParamInfo(paramCode);
        if (sysParamMap == null) {
            responseBean.setResult(ResultConstant.ERROR);
        } else {
            responseBean.setResult(ResultConstant.SUCCESS);
            responseBean.setResultData(sysParamMap);
        }
        return responseBean;
    }

}
